import { ALLOWED_FILE_TYPES } from '../constants/storage.constants';

export const fileFilter = (
  req: any,
  file: any,
  callback: (error: Error | null, acceptFile: boolean) => void,
) => {
  if (!ALLOWED_FILE_TYPES.includes(file.mimetype)) {
    return callback(new Error('文件类型不支持'), false);
  }
  callback(null, true);
};
